﻿using Dapper;
using MatTrace.Dtos;
using MatTrace.EntityFrameworkCore;
using MatTrace.Inputs;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Repositories.Dapper;
using Volo.Abp.EntityFrameworkCore;

namespace MatTrace
{
    public class Tmrbr001DapperRepository : DapperRepository<MatTraceDbContext>, ITmrbr001DapperRepository, ITransientDependency
    {
        public Tmrbr001DapperRepository(IDbContextProvider<MatTraceDbContext> dbContextProvider)
       : base(dbContextProvider)
        {
        }

        public async Task<Tmrbr001> FindSingleBySql(string sql, object param)
        {
            return await DbConnection.QueryFirstAsync<Tmrbr001>(sql, param,DbTransaction);
        }

        public Task<List<MatTrace001Dto>> GetTmrbr001ConfirmPlan(QueryTmrbr001Input queryTmrbr001Input)
        {
            throw new NotImplementedException();
        }





        /// <summary>
        /// 动态执行更语句
        /// </summary>
        /// <param name="sql"></param>
        /// <param name="param"></param>
        /// <returns></returns>
        public  virtual  async Task<int> UpdateBySql(string sql,object param)
        {
            return await this.DbConnection.ExecuteAsync(sql, param, DbTransaction);
        }

        
    }
}
